<?php
/**
*  index_controller
*/

class index_controller extends appcontroller {
	protected $cache;
	
	public function __construct(){
			parent::__construct();
			$this->cache = Cache::getInstance();
	}
	
	public function index($id=3){
		$this->view->id = $id;
		$user = new user();
		$data = $this->cache->get(md5('index'.$id));
		if(!$data) {
			$data = $user->findAllWithRelations(array('user_id','name','gender'),null,$id);
			$this->cache->set(md5('index'.$id),$data);
		}
		
		$this->view->data = $data;
		
		$this->render("index");
	}

}